<template>
  <div class="tool-select">
    <input class="tool-select_inner" v-model="selectValue">
    <icon-font class="iconfont" name="arrow_down"></icon-font>
  </div>
</template>

<script>
export default {
  props: {
    value: [String, Number],
    options: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  computed: {
    selectValue: {
      get () {
        return this.value
      },
      set (val) {
        this.$emit('input', val)
      }
    },
    selectOptions () {
      if (this.options.length === 0) {
        return [{value: '', label: '暂无内容'}]
      } else {
        return this.options
      }
    }
  }
}
</script>

<style scoped>
.tool-select{
  position: relative;
}
.tool-select_inner{
  height: 35px;
  width: 100%;
  padding: 0 10px;
  color: #666;
  box-sizing: border-box;
  outline: none;
  border: 1px solid #dedede;
  border-radius: 2px;
}
.iconfont{
  position: absolute;
  top: 3px;
  right: 10px;
  color: #666;
}
</style>